import pandas as pd
import time
import math
file_path = 'data/相亲对象.csv'
persons = pd.read_csv(file_path,encoding='gbk')
print(persons)

#
age = 29#男性年龄29想找一个年龄差距4岁以内的
curr_year = time.localtime(time.time()).tm_year
persons_birthdays = persons.loc[:,'出生日期']
age_cover = [math.fabs(age - (curr_year - time.strptime(persons_birthday,'%Y-%m-%d').tm_year)) <=2
             for persons_birthday in persons_birthdays]
print(age_cover)
stay_persons = persons.loc[age_cover]
print(stay_persons)
high = 170
persons_highs = stay_persons.loc[:,'身高']
high_cover = [math.fabs(170 - persons_high) < 8 for persons_high in persons_highs]
stay_persons = stay_persons[high_cover]
print(stay_persons)